import { createStore } from 'vuex'
const store = createStore({
  state() {
    return {
      count: 0,
    }
  },
  mutations: {
    increment(state) {
      state.count++
    },
    reduce(state) {
      state.count--
    },
  },
  actions: {
    increment(context) {
      context.commit('increment')
    },
    reduce({ commit }) {
      commit('reduce')
    },
  },
  getters: {
    count(state) {
      return state.count + 10
    },
  },
})
export default store
